import sys
import json

from cc.appcoin2.strategy.py_strat.strategy import StrategyBase


class PrintStrategy(StrategyBase):
  def __init__(self, driver_config):
    super().__init__(driver_config)

  def on_book_feed(self, book):
    jd = book.as_dict()
    print(json.dumps(jd, indent=2))

  def on_trade_feed(self, trade):
    jd = trade.as_dict()
    print(json.dumps(jd, indent=2))

strategy = PrintStrategy(driver_config=sys.argv[1])
strategy.run()
